package com.yuke.cloud.service.pmc.dao;

import com.yuke.cloud.common.core.mybatis.MyMapper;
import com.yuke.cloud.service.api.pmc.dto.ProdAttributeDto;
import com.yuke.cloud.service.api.pmc.dto.*;
import com.yuke.cloud.service.pmc.dto.*;
import com.yuke.cloud.service.pmc.entity.ProdSpec;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;
import java.util.Map;

public interface ProdSpecMapper extends MyMapper<ProdSpec> {

    List<ProdSpecInfoAndPriceDto> getRecommendAllList();
    List<ProdSpec> getEnableSpecByCategoryIds(@Param("categoryIds") List<Long> categoryIds);
    List<ProdSpecByCategoryDto> getSpecByCategoryIds(List<Long> categoryIds);
    List<Long> getProductIdsBySpecIds(List<Long> specIdList);
    Long getCategoryBySpecId(Long specId);
    int isEnable(@Param("specId") Long specId, @Param("isEnable") Integer isEnable);
    int isEnableProduct(@Param("productId") Long productId, @Param("isEnable") Integer isEnable);
    List<ProdSpecInfoAndPriceDto> getAppSpecByCondition(@Param("prodSpecInfoAndPrice") ProdSpecInfoAndPriceDto prodSpecInfoAndPrice);
    //PmcSpecFeignApi
    ProdSpecInfoDto getSpecInfoBySpecId(Long specId);//该查询没有限制是否：prodSpec.is_enable = 1，因为查询的是店铺已经进货的商品信息
    List<ProdSpecInfoDto> getSpecInfoBySpecIds(List<Long> specIds);
    Map<String, Integer> getPriceBySpecId(Long specId);
    List<ProdSpecInfoAndPriceDto> getSpecInfoDtosBySpecIds(@Param("list") Collection<Long> specIds);
    List<ProdSpecInfoDto> getSpecInfoDtosByCategoryIds(List<Long> categoryIds);
    List<ProdSpecInfoDto> getSpecInfoDtosByCondition(@Param("prodSpecInfoDto") ProdSpecInfoDto prodSpecInfoDto, @Param("categoryIds") List<Long> categoryIds);
    List<ProdSpecInfoDto> getSpecInfoListBySpecIds(@Param("specIds") List<Long> specIds);
    List<ProdSpecInfoDto> getSpecBySpecName(@Param("prodSpecInfoDto") ProdSpecInfoDto prodSpecInfoDto);
    List<ProdSpecInfoDto> getBySpecName(@Param("prodSpecInfoDto") ProdSpecInfoDto prodSpecInfoDto);
    List<ProdBrandDto> getBrands(@Param("categoryId") Long categoryId, @Param("saleType") Byte saleType, @Param("keyWord") String keyWord);
    void updateSaleCount(@Param("specId") Long specId, @Param("number") Long number);
    List<ProdSpecInfoAndPriceDto> getSpecBySpecIds(@Param("specIds") List<Long> specIds, @Param("saleType") Byte saleType);
    List<ProdMainAttrDetailDto> getMainAttribute(@Param("specId") Long specId, @Param("productId") Long productId);
    List<ProdMainAttrDetailDto> getMainAttributeList(@Param("productId") Long productId, @Param("saleType") Byte saleType);
    List<ProdSpecInfoAndPriceDto> getSpecByMainAttribute(@Param("prodMainAttrDto") ProdMainAttrDto prodMainAttrDto, @Param("saleType") Byte saleType);
    void deleteByProductId(@Param("productId")long productId);
    List<ProdSpecInfoExDto> getSpecIds(@Param("prodStorageDto")ProdStorageDto prodStorageDto);
    List<ProdSpecInfoExDto> getAppSpecInfoBySpecIds(@Param("specIds") List<Long> specIds);
    List<ProdSpecInfoDto> getImportSpecId(@Param("specName")String specName);

    List<ProdSpecGoodsDto> getProdSpecGoods(@Param("prodSpecGoodsDto")ProdSpecGoodsDto prodSpecGoodsDto);
    List<ProdSpecGoodsInfoDto> findSpecAll();
    List<ProdAttributeDto> getFindProdAttributes(@Param("specIds")List<Long> specIds);
    int updateSpecCode(@Param("prodSpec") ProdSpec prodSpec);

    List<ProdSpecInfoDto> getStorageSpecInfoBySpecIds(@Param("specIdsList") List<Long> specIdsList);

    List<ProdSpecInfoDto> getSpecIdByCategoryId(List<Long> list);

    List<ProdSpecApiDto> getSpecNameBySpecIds(@Param("list")List<Long> list);

    List<ProdSpecGoodsInfoDto> getSpecInfoBySpecCode(@Param("specCode") String specCode);

    List<ProdSpecApiDto> checkSpeCode(List<String> specCode);
}
